﻿function openNewTab(id, url, title,removeId) {


try
{
    var node = {
        attributes: {
            href: url
        },
        text: title,
        id: id
    }
    window.parent.addExampleTab(node);

    if (removeId != "") {
        var node = {
            attributes: {
                href: ""
            },
            text: "",
            id: removeId
        }
       window.parent.removeExampleTab(node);
    } 
    }catch(e)
    {
     window.open(url,"_self");
    }
    //window.parent.addExampleTab.apply(window.parent, [node]);
}

function openNewTabParent(id, url, title, removeId) {


    var node = {
        attributes: {
            href: url
        },
        text: title,
        id: id
    }
    window.parent.parent.addExampleTab(node);

    if (removeId != "") {
        var node = {
            attributes: {
                href: ""
            },
            text: "",
            id: removeId
        }
        window.parent.parent.removeExampleTab(node);
    }
    //window.parent.addExampleTab.apply(window.parent, [node]);
}



